import { showConfirmDialog } from 'vant'
import { useUserStore } from '@/stores'
const userStore = useUserStore()

import { push } from '@/router'

export async function onUserLogOut() {
  try {
    await showConfirmDialog({
      title: '温馨提示',
      message: '您确认要退出优医问诊吗？'
    })
    userStore.clearUser()
    push('/login')
  } catch (error) {
    console.log(error)
  }
}
